Xbasic

SQL::TableInfoInsertColumn Method

Syntax

Result_Flag as L = InsertColumn(Column as SQL::DataTypeInfo [, InsertBefore as N = 1])

Arguments

Result_Flag

Inicates whether the operation was successful.

SQL::TableInfo

A SQL::TableInfo object.

Column

A SQL::DataTypeInfo object.

InsertBefore

Optional. The column before which to insert the new column.

Description

Insert a new Column.

Discussion

The InsertColumn() method inserts a new column into the column property before the column specified by InsertBefore. Note : Names must not duplicate ("" counts as a name).

Example

dim ti as SQL::TableInfo
dim co1 as SQL::DataTypeInfo
dim co2 as SQL::DataTypeInfo
co1.Name = "Customer"
co1.AlphaType = "Character"
col2.Name = "Product"
col2.AlphaType = "Character"
? ti.AddColumn(co1)
= 1
? ti.InsertColumn(co2,1)
= .T.
? ti.ColumnNumber("Customer")
= 2

See Also